﻿package 
{
    import MainUI.*;
    import com.core.*;
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.sh.game.consts.*;
    import com.sh.game.display.*;
    import com.sh.game.global.*;
    import com.sh.game.util.*;
    import consts.*;
    import control.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import flash.utils.*;
    import manager.*;
    import morn.core.components.*;
    import morn.core.handlers.*;
    import morn.core.managers.*;
    import plugin.instances.*;
    import plugin.instances.game.*;
    import view.*;
    import view.buffer.*;
    import view.component.*;
    import view.effect.*;
    import view.expball.*;
    import view.mainUI.*;
    import view.mainUI.mainBottom.ui.*;
    import view.mainUI.powerview.*;
    import view.mainUI.td.*;
    import view.message.*;
    import view.prompt.*;
    import view.rongyu.*;
    import view.selectView.control.*;
    import view.sysNotice.*;
    import view.task.*;
    import view.tips.*;

    public class MainUI extends Object
    {
        private var _flashTips:Object;
        public var smallMap:SmallMapGame;
        public var taskView:TaskViewUI;
        public var activeButtonGroup:ActiveButtonGroup;
        private var _autoBattle:XMLMovieClip;
        private var _autoMove:XMLMovieClip;
        public var buffView:BuffersViewN;
        public var _Bigfint:BigFontINotice;
        private var _tipsManager:Tips;
        public var selectView:SelectViewUIControl;
        public var mainFuncView:MainBottom;
        public var tdRes:TdResults;
        private var _timeCounter:TimeCounter;
        private var taskjsMc:XMLMovieClip;
        private var taskwcMc:XMLMovieClip;
        private var plugins:SctjPlugin;
        private var _flashUI:Sprite;
        private var _flashUI2:Sprite;
        private var _flashTipsDown:Sprite;
        public var _attributeRun:AttributeRun;
        public var announce:Announce;
        public var notice:Notice;
        public var power:NewPowerView;
        public var leftGuide:LeftKaiQi;
        public var mobaiExp:MoBaiExp;
        public var prompt:PromptView;
        public var nbFly:NBFly;
        private var _byteLoader:Loader;
        public var itemEffect:ItemEffects;
        private var _tween:TweenMax;
        public var logUI:LogUI;
        public var mainUILoadComplete:Boolean = false;
        private var mSimpleVersion:Boolean = false;
        public var instances:Instances;
        private var _tdMenu:TdMenu;
        public var marquee:Marquee;
        private var inInstance:Boolean = false;
        private var stars:BezierStar;
        public var _getRun:GetRun;
        public var _temptation:Temptation;
        private var _smallLoading:SmallLoading;
        private var _expballMagic:ExpBallMagic;
        private var _RyballMagic:RYBallMagic;
        public var _horn:Horn;
        private var bosslist:BossListCtrl;
        public var promptView:PromptGame;
        private var _LieHuo:LieHuoBuff;
        public var _bmRunner:BmRunner;
        private var _lianzhan:LianZhan;
        private var _hornTimer:int = 0;
        private var _pao:XMLMovieClip;
        private var _hornSpeed:int = 300000;
        private var _ffbb:UrlImage;
        private var clearanceEff:XMLMovieClip;
        public var uiloader:Loader;
        private var sp:Sprite;
        private var sp1:Sprite;
        private const defaultexpreson:int = 1;
        private const recycleexpreson:int = 2;
        private const expmarkeexpreson:int = 3;
        private var _showmove:Boolean = false;
        public var Annouce:AnnounceView;
        private var autoBattleIng:Boolean = false;
        private var _swfLoading:Boolean = false;
        private var chatTimeLine:TimelineLite;
        private var _autoMoveing:int = 0;
        private var flag:Boolean = false;
        private var tType:int = 0;
        private var tasktypeArr:Array;
        private var timeoutID:uint = 0;
        private var _bufferTime:int = 0;
        private var timelast:int = 0;
        private var paoPoint:Point;
        public var autoEms:XMLMovieClip;
        private static var TaskY:int = 255;
        public static var UIRes:Dictionary = new Dictionary();
        private static var mainbitmap:BitmapData;

        public function MainUI(param1:Object, param2:Object, param3:Object, param4:Object)
        {
            this.sp = new Sprite();
            this.sp1 = new Sprite();
            this.tasktypeArr = [];
            GlobalLayer.instance.root.addEventListener(Event.RESIZE, this.resizeHandler);
            this._flashTips = param1;
            this._flashUI = Sprite(param2);
            this._flashUI2 = Sprite(param3);
            this._flashTipsDown = Sprite(param4);
            ImageS9BitmapData.UrlToSizeGrid = S9GridData.S9Data;
            var _loc_5:* = new MainSwfLoader(this.loadMainUI2);
            return;
        }// end function

        protected function loadPowerView() : void
        {
            var _loc_2:Object = null;
            this.power = new NewPowerView();
            this.power.y = 20;
            this._flashUI.addChild(this.power);
            var _loc_1:* = ModelProxy.getValue("data", "user");
            if (_loc_1)
            {
                _loc_2 = _loc_1.ability;
                if (_loc_2)
                {
                    this.power.oldPower = (this.numTarget(_loc_2.phyAtt) + this.numTarget(_loc_2.taoAtt) + this.numTarget(_loc_2.phyDef) + this.numTarget(_loc_2.magicAtt) + this.numTarget(_loc_2.magicDef)) / 2;
                }
            }
            this._flashUI.addChild(this.buffView);
            return;
        }// end function

        public function AdditemEffec3(param1) : void
        {
            ModelProxy.change("data", "hechengpoint", new Point(this._flashTips.mouseX, this._flashTips.mouseY - 270));
            this.itemEffect.add(param1);
            return;
        }// end function

        protected function loadMainUI2() : void
        {
            this._ffbb = new UrlImage();
            this._ffbb.url = "main/fcbb.png";
            this._ffbb.x = GlobalLayer.instance.flashStage.stageWidth - 237 - 10;
            this._ffbb.y = GlobalLayer.instance.flashStage.stageHeight - 30;
            this._ffbb.mouseChildren = false;
            this._ffbb.mouseEnabled = false;
            this.itemEffect = new ItemEffects(this._flashTips);
            PluginManager.instance.doRegister();
            this._tipsManager = new Tips(this._flashTips);
            this.mainFuncView = new MainBottom();
            this._flashUI.addChild(this.mainFuncView);
            this.mainFuncView.x = int(this._flashUI.stage.stageWidth - 733 >> 1);
            this.mainFuncView.y = int(this._flashUI.stage.stageHeight - 129);
            this.mainFuncView.menuControl.setPos();
            this.setSimpleVersion();
            var _loc_1:* = new Point();
            _loc_1.x = this.mainFuncView.skillBox.x;
            _loc_1.y = this.mainFuncView.skillBox.y;
            UIGlobel.pointsDic["setskill"] = this.mainFuncView.localToGlobal(_loc_1);
            this.startmain();
            this.loadPowerView();
            this.logUI = new LogUI();
            this.logUI.x = this._flashUI.stage.stageWidth - 140;
            if (this._flashUI.stage.stageHeight > 866)
            {
                this.logUI.y = this._flashUI.stage.stageHeight - 126 - 150;
            }
            else
            {
                this.logUI.y = this._flashUI.stage.stageHeight - 127;
            }
            this._flashUI.addChild(this.logUI);
            this.instances = new Instances();
            this._flashUI.addChild(this.instances);
            this.instances.x = this._flashUI.stage.stageWidth - 280;
            if (TaskY + 433 < this._flashUI.stage.stageHeight - 160)
            {
                this.instances.y = TaskY - 30;
            }
            else
            {
                this.instances.y = this._flashUI.stage.stageHeight - 433 - 220;
            }
            if (this.instances.y < 200)
            {
                this.instances.y = 200;
            }
            this.taskView = new TaskViewUI();
            this._flashUI.addChild(this.taskView);
            this.taskView.x = this._flashUI.stage.stageWidth - 210;
            this.taskView.y = this._flashUI.stage.stageHeight > 700 ? (255) : (195);
            this.leftGuide = new LeftKaiQi(160);
            this._flashUI.addChild(this.leftGuide);
            this.leftGuide.visible = false;
            this.mobaiExp = new MoBaiExp();
            this._flashUI.addChild(this.mobaiExp);
            this.mobaiExp.visible = false;
            this.mobaiExp.x = this._flashUI.stage.stageWidth - this.mobaiExp.width >> 1;
            this.mobaiExp.y = this._flashUI.stage.stageHeight - 310;
            this._horn = new Horn();
            this._flashUI.addChild(this._horn);
            this._horn.y = this._flashUI.stage.stageHeight - 222;
            this._hornTimer = setTimeout(this._hornTime, this._hornSpeed);
            UIVisibleManager.instance.register("horn", this._horn, UIVisibleManager.VLeft);
            this._temptation = new Temptation();
            this._flashUI.addChildAt(this._temptation, 0);
            this._temptation.x = 310;
            this._temptation.initSet();
            this.activeButtonGroup = new ActiveButtonGroup();
            this._flashUI.addChild(this.activeButtonGroup);
            this.activeButtonGroup.x = this._flashUI.stage.stageWidth - 260;
            this.activeButtonGroup.y = 42;
            this.uiloaded();
            this._lianzhan = new LianZhan(this._flashTipsDown);
            return;
        }// end function

        private function _hornTime() : void
        {
            if (this._hornTimer > 0)
            {
                clearTimeout(this._hornTimer);
            }
            if (ModelProxy.getValue("data", "openday") > 3)
            {
                return;
            }
            var _loc_1:* = UserData.getUserData("level");
            this._hornSpeed = 300000;
            this._hornTimer = setTimeout(this._hornTime, this._hornSpeed);
            var _loc_2:* = ConfigDictionary.data.tipswords;
            var _loc_3:* = _loc_2[int(Math.random() * _loc_2.length)].tips;
            this._horn.addHorn({TalkContent:"<font color=\'#cf26a5\'>" + _loc_3 + "</font>", titleMsg:"", RoleName:"", tempContent:_loc_3, isSys:"system"});
            return;
        }// end function

        public function showBossList(param1:Object = null) : void
        {
            if (param1 == null)
            {
                if (this.bosslist)
                {
                    this.bosslist.close();
                }
                return;
            }
            if (this.bosslist == null)
            {
                this.bosslist = new BossListCtrl();
                this._flashUI.addChild(this.bosslist);
            }
            this.bosslist.x = this._flashUI.stage.stageWidth - 484;
            this.bosslist.y = this._flashUI.stage.stageHeight > 700 ? (249) : (189);
            this.bosslist.onShow(param1);
            return;
        }// end function

        public function showClearance() : void
        {
            XMLMcManager.instance.MainuiMc("clearance", this.onComplete);
            return;
        }// end function

        private function onComplete(param1:XMLMovieClip) : void
        {
            if (this.clearanceEff)
            {
                this.clearEff();
            }
            this.clearanceEff = param1;
            GlobalLayer.instance.root.stage.addChild(this.clearanceEff);
            this.clearanceEff.interval = 200;
            this.clearanceEff.playFromTo(0, (this.clearanceEff.totalFrame - 1), new Handler(this.clearEff));
            this.clearanceEff.x = this._flashUI.stage.stageWidth - this.clearanceEff.width - 300 >> 1;
            this.clearanceEff.y = 50;
            return;
        }// end function

        public function clearEff() : void
        {
            if (this.clearanceEff)
            {
                if (this.clearanceEff.parent)
                {
                    this.clearanceEff.parent.removeChild(this.clearanceEff);
                }
                this.clearanceEff.stop();
                this.clearanceEff = null;
            }
            return;
        }// end function

        public function showAlert(param1:Object) : void
        {
            Alert2.show(param1.text, param1.title, param1.buttons, param1.callback, param1.args, param1.showClose, param1.model);
            return;
        }// end function

        protected function uiloaded() : void
        {
            var _loc_1:* = App.asset.getBitmapData("png.common.tips_bg1");
            var _loc_2:* = App.asset.getBitmapData("jpg.common.cs2_bg3");
            var _loc_3:* = App.asset.getBitmapData("png.common.tips_bg1");
            var _loc_4:* = App.asset.getBitmapData("jpg.common.cs2_bg3");
            var _loc_5:* = App.asset.getBitmapData("png.common.s9_fenline");
            var _loc_6:* = App.asset.getBitmapData("png.common.s9_frame");
            var _loc_7:* = App.asset.getBitmapData("png.common.tips2");
            var _loc_8:* = App.asset.getBitmapData("png.common.tips3");
            var _loc_9:* = App.asset.getBitmapData("png.common.tips5");
            var _loc_10:* = App.asset.getBitmapData("png.common.tips4");
            this._tipsManager.showQhadd(new Bitmap(App.asset.getBitmapData("png.common.qhadd")));
            var _loc_11:* = new Array();
            var _loc_12:int = 0;
            while (_loc_12 < 10)
            {
                
                _loc_11.push(App.asset.getBitmapData("png.common.nqh_" + _loc_12));
                this._tipsManager.showNumberBmps(_loc_11);
                _loc_12++;
            }
            this._tipsManager.showRanking(new Bitmap(_loc_3));
            this._tipsManager.showRing(new Bitmap(_loc_3));
            this._tipsManager.showTips(new Bitmap(_loc_1), new Bitmap(_loc_2), new Bitmap(_loc_5), new Bitmap(_loc_6));
            this._tipsManager.showTypes(new Bitmap(_loc_7), new Bitmap(_loc_8), new Bitmap(_loc_10), new Bitmap(_loc_9));
            this.mainUILoadComplete = true;
            return;
        }// end function

        private function getBitmaps(param1:Object, param2:BitmapData) : Bitmap
        {
            var _loc_3:* = new Bitmap();
            _loc_3.bitmapData = new BitmapData(param1.@width, param1.@height, true, 0);
            _loc_3.bitmapData = this.getBitmapData(param1, param2);
            return _loc_3;
        }// end function

        private function getBitmapData(param1:Object, param2:BitmapData) : BitmapData
        {
            var _loc_3:* = new Point(param1.@x, param1.@y);
            var _loc_4:* = param1.@width;
            var _loc_5:* = param1.@height;
            var _loc_6:* = new BitmapData(_loc_4, _loc_5, true, 0);
            new BitmapData(_loc_4, _loc_5, true, 0).copyPixels(param2, new Rectangle(_loc_3.x, _loc_3.y, _loc_4, _loc_5), new Point(0, 0), null, null, false);
            return _loc_6;
        }// end function

        public function startmain() : void
        {
            this.addMainView();
            this.addtips();
            this._flashUI2.addChild(this.sp);
            this._flashUI2.addChild(this.sp1);
            this._expballMagic = new ExpBallMagic(this.sp, this.updateEXPbar);
            this._RyballMagic = new RYBallMagic(this.sp1, null);
            this.sp1.x = GlobalLayer.instance.flashStage.stageWidth - 623 >> 1;
            this.sp1.y = GlobalLayer.instance.flashStage.stageHeight - 394 >> 1;
            this.initControls();
            this.plugins = new SctjPlugin(BindPluginClass.LocalPlugins);
            this.plugins.init({flashUI:GlobalLayer.instance.getLayer("flashUI"), flashTips:GlobalLayer.instance.getLayer("flashTips"), alertCon:GlobalLayer.instance.getLayer("alertCon")});
            return;
        }// end function

        private function updateEXPbar() : void
        {
            ModelProxy.change("mainview", "updateRoleExp", null);
            this._showmove = false;
            return;
        }// end function

        public function addRongYu(param1:int) : void
        {
            this.sp1.x = GlobalLayer.instance.flashStage.stageWidth - 623 >> 1;
            this.sp1.y = GlobalLayer.instance.flashStage.stageHeight - 394 >> 1;
            this._RyballMagic.playMovie(param1);
            return;
        }// end function

        public function checkEXP(param1:Object) : void
        {
            var _loc_2:* = param1.addexp;
            if (_loc_2 > 0 && param1.type == this.expmarkeexpreson)
            {
                this.sp.x = (ModelProxy.getValue("data", "lianzhiexpxy") as Point).x;
                this.sp.y = (ModelProxy.getValue("data", "lianzhiexpxy") as Point).y - 300;
                this._expballMagic.playMovie(_loc_2);
                this._showmove = true;
            }
            else if (_loc_2 > 0 && param1.type > 1)
            {
                this.sp.x = GlobalLayer.instance.flashStage.stageWidth - 200 >> 1;
                this.sp.y = GlobalLayer.instance.flashStage.stageHeight - 400 >> 1;
                this._showmove = true;
                this._expballMagic.playMovie(_loc_2);
            }
            else if (this._showmove)
            {
            }
            else
            {
                this.updateEXPbar();
            }
            return;
        }// end function

        private function addtips() : void
        {
            this.Annouce = new AnnounceView();
            this._flashTips.stage.addChild(this.Annouce);
            this.Annouce.x = this._flashUI.stage.stageWidth - 680 >> 1;
            this.announce = new Announce();
            GlobalLayer.instance.getLayer("flashTips").addChild(this.announce);
            this.announce.x = GlobalLayer.instance.root.stageWidth >> 1;
            this.announce.y = 180;
            this.notice = new Notice();
            GlobalLayer.instance.getLayer("flashTips").addChild(this.notice);
            this.notice.x = GlobalLayer.instance.root.stageWidth >> 1;
            this.notice.y = GlobalLayer.instance.root.stageHeight - 250;
            this._Bigfint = new BigFontINotice();
            this._Bigfint.x = int((GlobalLayer.instance.root.stageWidth - 1200) * 0.5);
            this._Bigfint.y = GlobalLayer.instance.root.stageHeight - 180;
            GlobalLayer.instance.getLayer("flashTips").addChild(this._Bigfint);
            this._Bigfint.close();
            GuideView.getInstance().init();
            NewGuideView.getInstance().init();
            GuideViewPao.getInstance().init();
            this.nbFly = new NBFly();
            return;
        }// end function

        public function showPower() : void
        {
            var _loc_1:* = UserData.getUserData();
            this.power.showPower(_loc_1.ability.nbValue + _loc_1.abilityBuf.nbValue);
            return;
        }// end function

        public function chanePkModel() : void
        {
            if (this.power)
            {
                this.power.chanePkModel();
            }
            return;
        }// end function

        private function numTarget(param1:Number) : int
        {
            var _loc_2:* = param1;
            var _loc_3:* = param1 >> 32;
            return _loc_2 + _loc_3;
        }// end function

        private function addMainView() : void
        {
            this._attributeRun = new AttributeRun();
            this._attributeRun.init(this._flashTips as DisplayObjectContainer, this._flashUI.stage.stageWidth >> 2, this._flashUI.stage.stageHeight >> 2);
            this.marquee = new Marquee();
            this._flashTips.addChild(this.marquee);
            this.smallMap = new SmallMapGame();
            this._flashUI.addChild(this.smallMap);
            this.smallMap.x = this._flashUI.stage.stageWidth - 216;
            this.smallMap.y = -2;
            this.selectView = new SelectViewUIControl();
            this._flashUI2.addChild(this.selectView);
            UIGlobel.pointsDic["map"] = new Point(this.smallMap.x + 30, 115);
            this.prompt = new PromptView();
            this._flashUI.addChild(this.prompt);
            this.prompt.x = this.mainFuncView.x;
            this.prompt.y = this.mainFuncView.y - 110;
            this.promptView = new PromptGame();
            this._flashUI.addChild(this.promptView);
            this.promptView.y = this._flashUI.stage.stageHeight - 244;
            this.buffView = new BuffersViewN();
            this._flashUI.addChild(this.buffView);
            this.buffView.y = 102;
            this._getRun = new GetRun();
            this._getRun.init(this._flashTips as DisplayObjectContainer, this._flashUI.stage.stageWidth >> 1, (this._flashUI.stage.stageHeight * 3 >> 2) - 20);
            this._bmRunner = new BmRunner();
            this._flashTipsDown.addChild(this._bmRunner);
            this._bmRunner.x = int(this._flashUI.stage.stageWidth / 2 - 100);
            this._bmRunner.y = this._flashUI.stage.stageHeight >> 1;
            this.tdRes = new TdResults();
            this._flashUI.addChild(this.tdRes);
            this.tdRes.y = 175;
            this.tdRes.x = this._flashUI.stage.stageWidth - 388 >> 1;
            this._timeCounter = new TimeCounter(this._flashUI);
            this._timeCounter.x = int(this._flashUI.stage.stageWidth / 2 - this._timeCounter.width / 2);
            this._timeCounter.y = 160;
            this.showAutoMove(0);
            this.showAutoBattle(false);
            this.stars = new BezierStar();
            this._flashTips.addChild(this.stars);
            return;
        }// end function

        public function setTdMenuView(param1:int = 2) : void
        {
            if (param1 == 1)
            {
                if (this._tdMenu == null)
                {
                    this._tdMenu = new TdMenu();
                    this._flashUI.addChild(this._tdMenu);
                }
                this._tdMenu.show(true);
            }
            if (this._tdMenu)
            {
                if (param1 == 0)
                {
                    this._tdMenu.visible = false;
                }
                else if (param1 == 1)
                {
                    this._tdMenu.visible = true;
                }
                this._tdMenu.x = int(this._flashUI.stage.stageWidth - 369 >> 1);
                this._tdMenu.y = int(this._flashUI.stage.stageHeight - 280);
            }
            return;
        }// end function

        public function updatetdtime() : void
        {
            if (this._tdMenu == null)
            {
                this._tdMenu = new TdMenu();
                this._flashUI.addChild(this._tdMenu);
            }
            this._tdMenu.show(false);
            return;
        }// end function

        public function updateTDCount(param1:Object, param2:int = 1) : void
        {
            this.setTdMenuView(param2);
            if (this._tdMenu)
            {
                this._tdMenu.update(param1);
            }
            return;
        }// end function

        public function gettdexp(param1:int) : void
        {
            if (this._tdMenu)
            {
                this._tdMenu.gettdexp(param1);
            }
            return;
        }// end function

        public function updateTdStart(param1:Boolean) : void
        {
            if (this._tdMenu)
            {
                this._tdMenu.updateTdStart(param1);
            }
            return;
        }// end function

        public function flyEff(param1:int) : void
        {
            var _loc_2:Point = null;
            switch(param1)
            {
                case 1:
                {
                    _loc_2 = UIGlobel.pointsDic["shenlu"];
                    break;
                }
                case 2:
                {
                    return;
                }
                case 3:
                {
                    _loc_2 = UIGlobel.pointsDic["role"];
                    break;
                }
                case 4:
                {
                    _loc_2 = UIGlobel.pointsDic["bag"];
                    break;
                }
                case 5:
                {
                    _loc_2 = UIGlobel.pointsDic["guanwei"];
                    break;
                }
                case 6:
                {
                    _loc_2 = UIGlobel.pointsDic["zhuanshengeffpos"];
                    break;
                }
                case 7:
                {
                    _loc_2 = UIGlobel.pointsDic["skill"];
                    break;
                }
                case 8:
                {
                    _loc_2 = UIGlobel.pointsDic["union"];
                    break;
                }
                default:
                {
                    break;
                }
            }
            this.stars.allMove(this._flashTips.mouseX, this._flashTips.mouseY, _loc_2.x - 63, _loc_2.y - 62);
            return;
        }// end function

        public function lianzhipiao() : void
        {
            var _loc_1:* = ModelProxy.getValue("data", "lianzhipiao").x;
            var _loc_2:* = ModelProxy.getValue("data", "lianzhipiao").y;
            this.stars.allMove(this._flashTips.mouseX, this._flashTips.mouseY, _loc_1, _loc_2);
            return;
        }// end function

        public function flytdEff(param1:Point) : void
        {
            var _loc_2:* = this._tdMenu.btn_zhaohuan.localToGlobal(new Point(0, 0));
            this.stars.allMove(param1.x, param1.y, _loc_2.x - 50, _loc_2.y - 50);
            this._tdMenu.showlight();
            return;
        }// end function

        public function inituser() : void
        {
            setTimeout(this.loadAutoMoveMC, 5000);
            this.loadAutoBattleMC();
            this.showAutoBattle(this.autoBattleIng);
            this.showAutoMove(this._autoMoveing);
            var _loc_1:* = UserData.getUserData();
            return;
        }// end function

        private function loadAutoBattleMC() : void
        {
            App.leisureMloader.loadSWF(Config.getUrl("assets/images/mainui/autobattle.swf"), 1, new Handler(function (param1) : void
            {
                _autoBattle = new XMLMovieClip("png.autobattle", new XML(new MainEmbeds.autobattleXML()));
                _flashUI.addChildAt(_autoBattle, 0);
                _autoBattle.play();
                _autoBattle.y = Math.max(int(_flashUI.stage.stageHeight - 300) / 2 - 210, 10);
                _autoBattle.x = int(_flashUI.stage.stageWidth - 300) / 2;
                showAutoBattle(autoBattleIng);
                return;
            }// end function
            ), null, null, false);
            return;
        }// end function

        private function loadAutoMoveMC() : void
        {
            App.leisureMloader.loadSWF(Config.getUrl("assets/images/mainui/automove.swf"), 1, new Handler(function (param1) : void
            {
                _autoMove = new XMLMovieClip("png.automove", new XML(new MainEmbeds.automoveXML()));
                _flashUI.addChildAt(_autoMove, 0);
                _autoMove.y = Math.max(int(_flashUI.stage.stageHeight - 300) / 2 - 210, 10);
                _autoMove.x = int(_flashUI.stage.stageWidth - 300) / 2;
                _autoMove.visible = false;
                showAutoMove(_autoMoveing);
                return;
            }// end function
            ), null, null, false);
            return;
        }// end function

        private function loadTaskSwf() : void
        {
            if (this._swfLoading)
            {
                return;
            }
            this._swfLoading = true;
            App.leisureMloader.loadSWF(Config.getUrl("assets/images/taskeffect/taskui.swf"), 1, new Handler(function (param1) : void
            {
                taskjsMc = new XMLMovieClip("png.taskui", new XML(new MainEmbeds.taskuiXML()));
                taskjsMc.x = int(_flashUI.stage.stageWidth - 512 - 240);
                taskjsMc.y = 20;
                taskjsMc.mouseChildren = false;
                taskjsMc.mouseEnabled = false;
                _flashUI.addChild(taskjsMc);
                taskjsMc.visible = false;
                taskjsMc.stop();
                taskwcMc = new XMLMovieClip("png.taskui1", new XML(new MainEmbeds.taskui1XML()));
                taskwcMc.x = int(_flashUI.stage.stageWidth / 2 - 300);
                taskwcMc.y = 100;
                taskwcMc.mouseChildren = false;
                taskwcMc.mouseEnabled = false;
                _flashUI.addChild(taskwcMc);
                taskwcMc.visible = false;
                taskwcMc.stop();
                return;
            }// end function
            ), null, null, false);
            return;
        }// end function

        public function updateAchievement() : void
        {
            this.mainFuncView.menuControl.updateAcm();
            return;
        }// end function

        public function closeTdResult() : void
        {
            this.tdRes.removeResult();
            return;
        }// end function

        public function tdEnd(param1:Object) : void
        {
            if (param1 == 0)
            {
                this.tdRes.showResult("f");
            }
            else
            {
                this.tdRes.showResult("s");
            }
            ModelProxy.change("mainuiInstance", "tdEnd", 60 * 5);
            var _loc_2:* = int((this._flashUI.stage.stageWidth - 492) / 2);
            ModelProxy.change("plugin", "open", {target:"npcdialog", point:new Point(this._flashUI.stage.stageWidth / 2, this._flashUI.stage.height / 2 - 120), top:new Point(_loc_2, 320), data:{npcid:112, type:"exittf"}});
            return;
        }// end function

        public function resultWindow(param1:Object) : void
        {
            if (param1 == 0)
            {
                this.tdRes.showResult("f");
            }
            else
            {
                this.tdRes.showResult("s");
            }
            return;
        }// end function

        private function stopGuajiHandler(param1 = null) : void
        {
            ModelProxy.change("zone", "stopGuaji", null);
            return;
        }// end function

        public function showMonster(param1:Object) : void
        {
            ModelProxy.change("mainuiInstance", "monsteratkint", param1);
            return;
        }// end function

        public function showSBKGC(param1:Object) : void
        {
            param1.type = InstanceType.SBK;
            param1.mapid = SBKGame.sbkmapid;
            this.instances.oldInitShow(param1);
            this.taskView.visible = false;
            ModelProxy.change("newguide", "hide", 0);
            this.inInstance = true;
            return;
        }// end function

        public function hideSBKGC() : void
        {
            this.instances.destroyShow();
            this.taskView.visible = true;
            this.changeEMSState();
            this.setTdMenuView(0);
            this.inInstance = false;
            return;
        }// end function

        public function doChatChange(param1:Boolean) : void
        {
            this.clearTween();
            this.chatTimeLine = new TimelineLite();
            if (param1)
            {
                if (this._horn)
                {
                    this.chatTimeLine.insert(new TweenLite(this._horn, 0.5, {y:this._flashUI.stage.stageHeight - 222 - 140}));
                }
                if (this.promptView)
                {
                    this.chatTimeLine.insert(new TweenLite(this.promptView, 0.5, {y:this._flashUI.stage.stageHeight - 244 - 30 * int(ModelProxy.getValue("data", "promptRow")) - 140}));
                }
            }
            else
            {
                if (this._horn)
                {
                    this.chatTimeLine.insert(new TweenLite(this._horn, 0.5, {y:this._flashUI.stage.stageHeight - 222}));
                }
                if (this.promptView)
                {
                    this.chatTimeLine.insert(new TweenLite(this.promptView, 0.5, {y:this._flashUI.stage.stageHeight - 244 - 30 * int(ModelProxy.getValue("data", "promptRow"))}));
                }
            }
            return;
        }// end function

        public function clearTween() : void
        {
            if (this.chatTimeLine)
            {
                this.chatTimeLine.kill();
                this.chatTimeLine = null;
            }
            return;
        }// end function

        private function resizeHandler(event:Event) : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:Point = null;
            this.setTdMenuView();
            var _loc_2:* = ModelProxy.getValue("data", "chatScale");
            if (this._autoMove)
            {
                this._autoMove.y = Math.max(int(this._flashUI.stage.stageHeight - 300) / 2 - 210, 10);
                this._autoMove.x = int(this._flashUI.stage.stageWidth - 300) / 2;
            }
            if (this._autoBattle)
            {
                this._autoBattle.y = Math.max(int(this._flashUI.stage.stageHeight - 300) / 2 - 210, 10);
                this._autoBattle.x = int(this._flashUI.stage.stageWidth - 300) / 2;
            }
            if (this.clearanceEff)
            {
                this.clearanceEff.x = this._flashUI.stage.stageWidth - this.clearanceEff.width >> 1;
            }
            if (this._ffbb)
            {
                this._ffbb.x = GlobalLayer.instance.flashStage.stageWidth - 237 - 10;
                this._ffbb.y = GlobalLayer.instance.flashStage.stageHeight - 30;
            }
            if (this.bosslist)
            {
                this.bosslist.x = this._flashUI.stage.stageWidth - 484;
            }
            if (this.promptView)
            {
                this.clearTween();
                if (_loc_2)
                {
                    this.promptView.y = this._flashUI.stage.stageHeight - 244 - 30 * int(ModelProxy.getValue("data", "promptRow")) - 140;
                }
                else
                {
                    this.promptView.y = this._flashUI.stage.stageHeight - 244 - 30 * int(ModelProxy.getValue("data", "promptRow"));
                }
            }
            if (this._LieHuo)
            {
                this._LieHuo.y = this._flashUI.stage.stageHeight - 185;
                this._LieHuo.x = int(this._flashUI.stage.stageWidth + 10) / 2;
            }
            if (this._getRun)
            {
                this._getRun.init(this._flashTips as DisplayObjectContainer, this._flashUI.stage.stageWidth >> 1, this._flashUI.stage.stageHeight * 3 >> 2);
            }
            if (this._horn)
            {
                this.clearTween();
                if (_loc_2)
                {
                    this._horn.y = this._flashUI.stage.stageHeight - 222 - 140;
                }
                else
                {
                    this._horn.y = this._flashUI.stage.stageHeight - 222;
                }
            }
            if (this._timeCounter)
            {
                this._timeCounter.x = int(this._flashUI.stage.stageWidth / 2 - this._timeCounter.width / 2);
            }
            if (this._bmRunner)
            {
                this._bmRunner.x = int(this._flashUI.stage.stageWidth / 2 - 100);
                this._bmRunner.y = this._flashUI.stage.stageHeight >> 1;
            }
            if (this.logUI)
            {
                this.logUI.x = this._flashUI.stage.stageWidth - 140;
                if (this._flashUI.stage.stageHeight > 866)
                {
                    this.logUI.y = this._flashUI.stage.stageHeight - 126 - 150;
                }
                else
                {
                    this.logUI.y = this._flashUI.stage.stageHeight - 127;
                }
            }
            if (this.instances)
            {
                this.instances.x = this._flashUI.stage.stageWidth - 280;
                if (TaskY + 433 < this._flashUI.stage.stageHeight - 160)
                {
                    this.instances.y = TaskY - 30;
                }
                else
                {
                    this.instances.y = this._flashUI.stage.stageHeight - 433 - 220;
                }
                if (this.instances.y < 200)
                {
                    this.instances.y = 200;
                }
            }
            if (this._attributeRun)
            {
                this._attributeRun.init(this._flashUI as DisplayObjectContainer, this._flashUI.stage.stageWidth >> 2, this._flashUI.stage.stageHeight >> 2);
            }
            if (this.taskjsMc)
            {
                this.taskjsMc.x = int(this._flashUI.stage.stageWidth - 610);
                this.taskwcMc.x = int(this._flashUI.stage.stageWidth / 2 - 300);
            }
            if (this.Annouce)
            {
                this.Annouce.x = int(this._flashUI.stage.stageWidth - 680 >> 1);
            }
            if (this.smallMap)
            {
                this.smallMap.x = this._flashUI.stage.stageWidth - 216;
                UIGlobel.pointsDic["map"] = new Point(this.smallMap.x + 30, 115);
            }
            if (this.activeButtonGroup)
            {
                this.activeButtonGroup.x = this._flashUI.stage.stageWidth - 260;
                this.activeButtonGroup.fashentips("fashen");
            }
            if (this.mainFuncView)
            {
                _loc_3 = int(this._flashUI.stage.stageWidth - 733 >> 1);
                _loc_4 = int(this._flashUI.stage.stageHeight - 129);
                this.mainFuncView.x = _loc_3;
                this.mainFuncView.y = this.mainFuncView.menuControl.isLow ? (_loc_4 + 20) : (_loc_4);
                this.mainFuncView.menuControl.setPos();
                _loc_5 = new Point();
                _loc_5.x = this.mainFuncView.skillBox.x;
                _loc_5.y = this.mainFuncView.skillBox.y;
                UIGlobel.pointsDic["setskill"] = this.mainFuncView.localToGlobal(_loc_5);
                this.setSimpleVersion();
            }
            if (this.announce)
            {
                this.announce.x = GlobalLayer.instance.root.stageWidth >> 1;
                this.announce.y = 180;
            }
            if (this.notice)
            {
                this.notice.x = GlobalLayer.instance.root.stageWidth >> 1;
                this.notice.y = GlobalLayer.instance.root.stageHeight - 250;
            }
            if (this._Bigfint)
            {
                this._Bigfint.x = int((GlobalLayer.instance.root.stageWidth - 1200) * 0.5);
                this._Bigfint.y = GlobalLayer.instance.root.stageHeight - 180;
            }
            if (this.prompt)
            {
                this.prompt.x = this.mainFuncView.x;
                this.prompt.y = this.mainFuncView.y - 110;
            }
            if (this.taskView)
            {
                this.taskView.x = this._flashUI.stage.stageWidth - 210;
                this.taskView.y = this._flashUI.stage.stageHeight > 700 ? (255) : (195);
            }
            if (this.tdRes)
            {
                this.tdRes.x = this._flashUI.stage.stageWidth - 388 >> 1;
            }
            if (this.mobaiExp)
            {
                this.mobaiExp.x = this._flashUI.stage.stageWidth - this.mobaiExp.width >> 1;
                this.mobaiExp.y = this._flashUI.stage.stageHeight - 310;
            }
            return;
        }// end function

        public function timeCount(param1:int, param2:int) : void
        {
            return;
        }// end function

        public function showAutoBattle(param1:Boolean) : void
        {
            var show:* = param1;
            this.autoBattleIng = show;
            if (show)
            {
                if (this._autoBattle)
                {
                    this._autoBattle.visible = true;
                }
                this.showAutoMove(0);
                clearTimeout(this.timeoutID);
                this.timeoutID = 0;
                ModelProxy.change("newguide", "hide", 0);
                this.mainFuncView.menuControl.guajiIng = true;
            }
            else
            {
                if (this._autoBattle)
                {
                    this._autoBattle.visible = false;
                }
                this.mainFuncView.menuControl.guajiIng = false;
                clearTimeout(this.timeoutID);
                this.timeoutID = 0;
                this.timeoutID = setTimeout(function () : void
            {
                if (autoBattleIng == false && _autoMoveing == 0 && taskView && taskView.visible)
                {
                    ModelProxy.change("newguide", "doguide", GuideType.GUIDE_RW);
                }
                return;
            }// end function
            , 800);
            }
            ModelProxy.change("mainuiInstance", "changeGj", show);
            return;
        }// end function

        public function showAutoMove(param1:int) : void
        {
            var show:* = param1;
            this._autoMoveing = show;
            if (show == 2 || show == 1)
            {
                clearTimeout(this.timeoutID);
                this.timeoutID = 0;
                ModelProxy.change("newguide", "hide", 0);
            }
            else if (show == 0)
            {
                clearTimeout(this.timeoutID);
                this.timeoutID = 0;
                this.timeoutID = setTimeout(function () : void
            {
                if (autoBattleIng == false && _autoMoveing == 0 && taskView && taskView.visible)
                {
                    ModelProxy.change("newguide", "doguide", GuideType.GUIDE_RW);
                }
                return;
            }// end function
            , 800);
            }
            if (this._autoMove == null)
            {
                return;
            }
            if (show == 1)
            {
                if (!this._autoMove.visible)
                {
                    this._autoMove.visible = true;
                    this._autoMove.play();
                }
            }
            else if (this._autoMove.visible)
            {
                this._autoMove.visible = false;
                this._autoMove.stop();
            }
            return;
        }// end function

        public function showCounter(param1:int, param2:int) : void
        {
            this._timeCounter.update(param1, param2);
            return;
        }// end function

        public function clearCounter(param1:int) : void
        {
            this._timeCounter.clear(param1);
            return;
        }// end function

        public function initControls() : void
        {
            var _loc_1:* = Control.create(MainUIControl, this);
            ModelProxy.addObserver("systemset", _loc_1);
            ModelProxy.addObserver("mainui", _loc_1);
            ModelProxy.addObserver("localCache", _loc_1);
            ModelProxy.addObserver("ems", _loc_1);
            ModelProxy.change("server", "addHandler", {group:117, handler:new TaskGroupHandler(), type:ConnectType.SYSTEM});
            return;
        }// end function

        public function removeActiveBtn(param1:String) : void
        {
            this.activeButtonGroup.removeBtn(param1);
            return;
        }// end function

        public function showTaskMc(param1:int, param2:Boolean = true) : void
        {
            var type:* = param1;
            var newis:* = param2;
            if (this.taskjsMc == null)
            {
                this.loadTaskSwf();
                return;
            }
            if (this.flag)
            {
                if (newis)
                {
                    this.tasktypeArr.push(type);
                }
                return;
            }
            this.flag = true;
            if (type == 2)
            {
                this.taskwcMc.visible = true;
                this.taskwcMc.playFromTo(0, (this.taskwcMc.totalFrame - 1), new Handler(function () : void
            {
                taskwcMc.visible = false;
                taskwcMc.stop();
                flag = false;
                if (tasktypeArr.length > 0)
                {
                    showTaskMc(tasktypeArr.shift(), false);
                }
                return;
            }// end function
            ));
                this.flag = false;
                if (this.tasktypeArr.length > 0)
                {
                    this.showTaskMc(this.tasktypeArr.shift(), false);
                }
            }
            else
            {
                this.taskjsMc.visible = true;
                this.taskjsMc.playFromTo(0, (this.taskjsMc.totalFrame - 1), new Handler(function () : void
            {
                taskjsMc.visible = false;
                taskjsMc.stop();
                flag = false;
                if (tasktypeArr.length > 0)
                {
                    showTaskMc(tasktypeArr.shift(), false);
                }
                return;
            }// end function
            ));
            }
            return;
        }// end function

        public function setUIState(param1:int) : void
        {
            if (param1 == 0)
            {
                this._flashUI.visible = true;
            }
            else
            {
                this._flashUI.visible = false;
            }
            return;
        }// end function

        public function showInstance(param1:Boolean, param2:int = 0) : void
        {
            var _loc_3:Object = null;
            if (param1)
            {
                _loc_3 = ConfigDictionary.data.instance;
                if (int(_loc_3[param2].type) == 0)
                {
                    this.showInstance(false);
                    return;
                }
                this.instances.oldInitShow(_loc_3[param2]);
                this.taskView.visible = false;
                ModelProxy.change("newguide", "hide", 0);
            }
            else
            {
                this.instances.destroyShow();
                this.taskView.visible = true;
                this.changeEMSState();
                this.setTdMenuView(0);
            }
            this.inInstance = param1;
            return;
        }// end function

        public function checkEmsMove() : void
        {
            if (!this.taskView.visible)
            {
                WarningManager.show(140);
            }
            return;
        }// end function

        public function changeEMSState() : void
        {
            var _loc_2:int = 0;
            var _loc_3:Object = null;
            if (this.inInstance)
            {
                return;
            }
            var _loc_1:* = ModelProxy.getValue("data", "ems");
            if (_loc_1 && _loc_1[1] == true && _loc_1[0] > 0)
            {
                this.taskView.visible = false;
                ModelProxy.change("newguide", "hide", 0);
                this.instances.oldInitShow({type:100});
            }
            else
            {
                _loc_2 = ModelProxy.getValue("data", "selfUnionEmsState");
                _loc_3 = ModelProxy.getValue("data", "unionEmsState");
                if (_loc_3 && _loc_3.state == 1 && _loc_2 == 1)
                {
                    this.taskView.visible = false;
                    ModelProxy.change("newguide", "hide", 0);
                    this.instances.oldInitShow({type:102});
                }
                else
                {
                    this.taskView.visible = true;
                    this.instances.destroyShow();
                }
            }
            return;
        }// end function

        private function setSimpleVersion() : void
        {
            if (GlobalLayer.instance.root.stageWidth < 1500)
            {
                if (this.mainFuncView)
                {
                    if (this.mSimpleVersion)
                    {
                        this.mainFuncView.x = int(this._flashUI.stage.stageWidth - 937 >> 1) + 60;
                    }
                    else
                    {
                        this.mainFuncView.x = int(this._flashUI.stage.stageWidth - 937 >> 1) + 150;
                    }
                }
            }
            return;
        }// end function

        public function get smallLoading() : SmallLoading
        {
            if (!this._smallLoading)
            {
                this._smallLoading = new SmallLoading();
                this._flashUI.addChild(this._smallLoading);
                this._smallLoading.x = this._flashUI.stage.stageWidth / 2;
                this._smallLoading.y = this._flashUI.stage.stageHeight / 2 + 200;
            }
            return this._smallLoading;
        }// end function

        public function set simpleVersion(param1:Boolean) : void
        {
            this.mSimpleVersion = param1;
            ModelProxy.change("mainview", "tempMenuLow", param1);
            this.setSimpleVersion();
            return;
        }// end function

        public function get simpleVersion() : Boolean
        {
            return this.mSimpleVersion;
        }// end function

        public function doeffect(param1:int) : void
        {
            var _loc_7:int = 0;
            var _loc_2:* = ConfigDictionary.data.chapter;
            var _loc_3:* = _loc_2[param1];
            if (_loc_3 == null)
            {
                return;
            }
            var _loc_4:* = new Label();
            new Label().width = 115;
            _loc_4.height = 20;
            _loc_4.stroke = "0x0";
            _loc_4.align = "left";
            _loc_4.isHtml = true;
            _loc_4.color = MColor.New30;
            _loc_4.x = this.taskView.x;
            _loc_4.y = this.taskView.y;
            var _loc_5:* = int(_loc_3.shuxing);
            switch(_loc_5)
            {
                case 1:
                {
                    _loc_7 = UserData.getUserData("career");
                    if (_loc_7 == 1)
                    {
                        _loc_4.text = "物理攻击：" + _loc_3.count + "-" + _loc_3.count;
                    }
                    else if (_loc_7 == 2)
                    {
                        _loc_4.text = "魔法攻击：" + _loc_3.count + "-" + _loc_3.count;
                    }
                    else
                    {
                        _loc_4.text = "道士攻击：" + _loc_3.count + "-" + _loc_3.count;
                    }
                    break;
                }
                case 2:
                {
                    _loc_4.text = "物理防御： " + _loc_3.count + "-" + _loc_3.count + "魔法防御： " + _loc_3.count + "-" + _loc_3.count;
                    break;
                }
                case 3:
                {
                    _loc_4.text = "生命上限： " + _loc_3.count;
                    break;
                }
                case 4:
                {
                    _loc_4.text = "魔法上限： " + _loc_3.count;
                    break;
                }
                default:
                {
                    break;
                    break;
                }
            }
            this._flashUI.addChild(_loc_4);
            var _loc_6:* = UIGlobel.pointsDic["role"];
            TweenLite.to(_loc_4, 3, {x:_loc_6.x, y:_loc_6.y, onComplete:this.doTxtRemove, ease:Circ.easeOut, onCompleteParams:[_loc_4]});
            return;
        }// end function

        private function doTxtRemove(param1:Label) : void
        {
            if (param1)
            {
                param1.parent.removeChild(param1);
            }
            param1 = null;
            return;
        }// end function

        public function addLieHuoBuff(param1:Object) : void
        {
            if (!this._LieHuo)
            {
                this._LieHuo = new LieHuoBuff();
            }
            this._LieHuo.alpha = 1;
            this.timelast = param1.msg.dispelTime;
            this._LieHuo._txt.text = this.timelast + "秒";
            if (this._bufferTime == 0)
            {
                this._bufferTime = setInterval(this.dotime, 1000);
            }
            this._LieHuo.y = this._flashUI.stage.stageHeight - 185;
            this._LieHuo.x = int(this._flashUI.stage.stageWidth + 10) / 2;
            this._LieHuo.data = param1;
            this._flashTipsDown.addChildAt(this._LieHuo, 0);
            return;
        }// end function

        private function dotime() : void
        {
            var _loc_1:String = this;
            var _loc_2:* = this.timelast - 1;
            _loc_1.timelast = _loc_2;
            if (this.timelast <= 3)
            {
                this._tween = TweenMax.to(this._LieHuo, 0.5, {alpha:0.3, repeat:100, yoyo:true});
            }
            this._LieHuo._txt.text = this.timelast + "秒";
            return;
        }// end function

        public function removeLieHuoBuff(param1:int) : void
        {
            if (this._LieHuo)
            {
                if (this._LieHuo._data.msg.bufferid == param1)
                {
                    if (this._tween)
                    {
                        this._tween.kill();
                        this._tween = null;
                    }
                    if (this._bufferTime > 0)
                    {
                        clearInterval(this._bufferTime);
                        this._bufferTime = 0;
                    }
                    if (this._LieHuo.parent)
                    {
                        this._LieHuo.parent.removeChild(this._LieHuo);
                    }
                }
            }
            return;
        }// end function

        public function changePao(param1:Boolean) : void
        {
            if (param1)
            {
                if (this._pao == null)
                {
                    XMLMcManager.instance.MainuiMc("pao", this.clip1CompleteHandler);
                }
            }
            else if (this._pao != null)
            {
                this._flashTipsDown.removeChild(this._pao);
                GlobalLayer.instance.root.stage.removeEventListener(Event.ENTER_FRAME, this.changePaoPos);
                this._pao = null;
            }
            return;
        }// end function

        private function clip1CompleteHandler(param1:XMLMovieClip) : void
        {
            if (param1)
            {
                this._pao = param1;
                if (this.paoPoint == null)
                {
                    this.paoPoint = ModelProxy.getValue("data", "rolePos");
                }
                this._pao.x = this.paoPoint.x - 260;
                this._pao.y = this.paoPoint.y - 480;
                this._pao.interval = 120;
                this._pao.play();
                this._pao.mouseEnabled = false;
                this._flashTipsDown.addChild(this._pao);
                GlobalLayer.instance.root.stage.removeEventListener(Event.ENTER_FRAME, this.changePaoPos);
                GlobalLayer.instance.root.stage.addEventListener(Event.ENTER_FRAME, this.changePaoPos);
            }
            return;
        }// end function

        protected function changePaoPos(event:Event) : void
        {
            if (this._pao)
            {
                this._pao.x = this.paoPoint.x - 260;
                this._pao.y = this.paoPoint.y - 480;
            }
            else
            {
                GlobalLayer.instance.root.stage.removeEventListener(Event.ENTER_FRAME, this.changePaoPos);
            }
            return;
        }// end function

        public function changeAutoEmsEff(param1:Boolean) : void
        {
            if (param1)
            {
                if (this.autoEms == null)
                {
                    XMLMcManager.instance.MainuiMc("autoems", this.autoEmsComp);
                }
            }
            else if (this.autoEms != null)
            {
                this._flashTipsDown.removeChild(this.autoEms);
                this.autoEms = null;
            }
            return;
        }// end function

        private function autoEmsComp(param1:XMLMovieClip) : void
        {
            if (param1)
            {
                if (ModelProxy.getValue("data", "isAutoEms"))
                {
                    this.autoEms = param1;
                    this.autoEms.x = GlobalLayer.instance.root.stage.width - this.autoEms.width - 500 >> 1;
                    this.autoEms.y = 160;
                    this.autoEms.interval = 120;
                    this.autoEms.play();
                    this.autoEms.mouseEnabled = false;
                    this._flashTipsDown.addChild(this.autoEms);
                }
            }
            return;
        }// end function

        public function showFaShenGuide() : void
        {
            if (this.activeButtonGroup)
            {
                this.activeButtonGroup.fashentips("fashen");
            }
            return;
        }// end function

        public static function copyBitmapData(param1:String) : BitmapData
        {
            var _loc_2:Rectangle = null;
            var _loc_3:BitmapData = null;
            if (UIRes[param1] && mainbitmap)
            {
                _loc_2 = UIRes[param1];
                _loc_3 = new BitmapData(_loc_2.width, _loc_2.height, true, 0);
                _loc_3.copyPixels(mainbitmap, _loc_2, new Point(0, 0), null, null, false);
                return _loc_3;
            }
            return null;
        }// end function

    }
}
